<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {if condition="$is_home"}
    <!-- 首页使用系统配置的TDK -->
    <title>{$config.web_title ?: ($config.web_name ?: 'CMS系统')}</title>
    <meta name="keywords" content="{$config.web_keywords ?: ''}">
    <meta name="description" content="{$config.web_description ?: ''}">
    {else /}
    <!-- 内页使用页面自定义TDK -->
    <title>{$title ?: '网站标题'} - {$config.web_name ?: 'CMS系统'}</title>
    <meta name="keywords" content="{$keywords ?: ''}">
    <meta name="description" content="{$description ?: ''}">
    {/if}
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5f5f5;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        header {
            background: #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 20px 0;
        }
        header h1 {
            font-size: 28px;
            color: #333;
        }
        nav {
            margin-top: 15px;
        }
        nav a {
            color: #666;
            text-decoration: none;
            margin-right: 20px;
            padding: 5px 10px;
            border-radius: 4px;
            transition: all 0.3s;
        }
        nav a:hover {
            background: #f0f0f0;
            color: #333;
        }
        main {
            margin: 30px 0;
            min-height: 500px;
        }
        footer {
            background: #333;
            color: #fff;
            text-align: center;
            padding: 20px 0;
            margin-top: 50px;
        }
        .content-box {
            background: #fff;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <h1>{$config.web_name ?: 'CMS系统'}</h1>
            <nav>
                <a href="/index.html">首页</a>
                <a href="/articles.html">文章</a>
                <a href="/about.html">关于</a>
            </nav>
        </div>
    </header>

    <main>
        <div class="container">
            {block name="content"}{/block}
        </div>
    </main>

    <footer>
        <div class="container">
            {notempty name="config.web_copyright"}
            <p>{$config.web_copyright|raw}</p>
            {else /}
            <p>&copy; 2024 {$config.web_name ?: 'CMS系统'}. All rights reserved.</p>
            {/notempty}

            {notempty name="config.web_recordnum"}
            <p style="margin-top: 10px;">{$config.web_recordnum|raw}</p>
            {/notempty}

            {notempty name="config.web_garecordnum"}
            <p style="margin-top: 5px;">{$config.web_garecordnum|raw}</p>
            {/notempty}

            <p style="margin-top: 10px; font-size: 12px; opacity: 0.8;">Powered by ThinkPHP 8</p>
        </div>
    </footer>

    <!-- 第三方代码 -->
    {notempty name="config.web_thirdcode_pc"}
    {$config.web_thirdcode_pc|raw}
    {/notempty}
</body>
</html>
